package com.bsoft.gol.hbs.healthinfo.state;


import com.bsoft.gol.hbs.bean.enums.ArticleStatusEnum;
import com.bsoft.gol.hbs.healthinfo.AbstractState;
import com.bsoft.gol.hbs.healthinfo.State;

/**
 * 编辑中状态
 *
 * @author linyi
 * @date 2021/10/13 17:41
 */
public class EditedState extends AbstractState {

    public EditedState() {
        super(ArticleStatusEnum.EDITED.getState());
    }

    @Override
    public boolean forwardNext() {
        return true;
    }

    @Override
    public boolean forwardPrev() {
        return false;
    }


    @Override
    public State getNext() {
        return new SubmittedState();
    }

    @Override
    public State getPrev() {
        setErrorMessage("当前为编辑中状态,无法回退至上一个状态");
        return null;
    }

}
